package vip.specimen.system.datasource.validation;

import lombok.Getter;
import lombok.Setter;
import vip.specimen.system.datasource.validation.annotation.Categories;
import vip.specimen.system.datasource.validation.annotation.Tags;
import vip.specimen.system.datasource.validation.annotation.TitleUnique;

import javax.persistence.*;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.Set;
import java.util.UUID;

/**
 * *@Author: 余浪人
 * *@Date：2021/4/9 10:39
 * *@Email:yulangren520@Gmail.com
 * *@QQ:1368419640
 **/
@Getter
@Setter
public class SystemArticleValidation {
    @TitleUnique
    @NotBlank(message = "标题不能为空")
    @Size(max = 255, message = "标题过长")
    private String title;
    @Size(max = 255, message = "来源信息过长")
    private String source;
    @Categories
    @Valid
    @Size(min = 1, message = "至少选择一个所属分类")
    private Set<UUID> categories;
    @Size(max = 255, message = "作者信息过长")
    private String author;
    @Size(max = 1024, message = "缩略图过长")
    private String thumb;
    private int state = 1;
    @Column(length = 2147483647)
    private String content;
    @Tags
    private Set<UUID> tags;
    @Size(max = 1024, message = "关键词信息过长")
    private String keyword;
    @Size(max = 2048, message = "描述信息过长")
    private String description;
    private Integer click = 0;
    private Boolean focus = Boolean.FALSE;
    private Boolean roll = Boolean.FALSE;
    private Boolean top = Boolean.FALSE;
    private Boolean recommend = Boolean.FALSE;
    private Boolean contribute = Boolean.FALSE;
    private Boolean other = Boolean.FALSE;
}
